 <%@ taglib prefix="s" uri="/struts-tags"  %>
 
<script type="text/javascript">  
$().ready(function() {  
	   
	$('#add').click(function() {  
    return !$('#newUsersOutsideTask option:selected').remove().appendTo('#newUsersInsideTask');  
   });  
   
   $('#remove').click(function() {  
    return !$('#newUsersInsideTask option:selected').remove().appendTo('#newUsersOutsideTask');  
   });
}); 

function saveUsersInTask(idTask) {
	$('#newUsersInsideTask option').attr('selected','true');
	$.post('./task/saveUsersTask.action', $('#formUsersTask').serialize() ,function(resultadoHTML) {
	});
	viewTask(idTask);
}

</script>  
   
<div class="transferSelect">
<form id="formUsersTask">

	<s:hidden name="id"/>

	<div class="selectBox">  
		<s:select  multiple="true" list="userPersonsOutsideTask" listKey="id" listValue="name" name="newUsersOutsideTask"></s:select>
		<a href="#" id="add">add &gt;&gt;</a>  
	</div>
	  
	<div class="selectBox">  
		<s:select  multiple="true" list="userPersons" listKey="id" listValue="name" name="newUsersInsideTask"></s:select>
		<a href="#" id="remove">&lt;&lt; remove</a>  
	</div>
</form>	

	<a href="#" onclick="saveUsersInTask(<s:property value="id"/>)">Save &gt;&gt;</a>  
</div>

